package creational.builder;

/**
 * @ClassName: Director
 * @Description: 指挥者(Director)
 * @Author: liu-hao
 * @Date: 2023-05-19 23:07
 * @Version: 1.0
 **/
public class Director {
    private ComputerBuilder computerBuilder;

    public void setComputerBuilder(ComputerBuilder computerBuilder) {
        this.computerBuilder = computerBuilder;
    }

    public Computer getComputer() {
        return computerBuilder.buildComputer()
                .buildMaster()
                .buildScreen()
                .buildKeyboard()
                .buildMouse()
                .buildAudio()
                .getComputer();
    }
}